<?php include 'header.php' ?>
    <div id="dialog" title="Xác nhận">
        <p> Bạn chắc chắn muốn xóa?</p>
        <button onclick="deleteProduct();">Có</button>
        <button onclick="closeDialog()">Không</button>
    </div>

    <article>
        <div class="clear"/>

        <section class="list-content">
            <div class="giohang">Quản lý sản phẩm</div>
            <div id="product_form" style="text-align: left;margin-left: 100px;">
                <p id="message"></p>

                <form action="">
                    <div>
                        <input type="hidden" id="id_product">
                        <table>
                            <tr>
                                <td><label for="ime_product">Mã số: </label></td>
                                <td><input type="text" onsubmit="$('#ime_product').val(generateIMEProduct());"
                                           disabled="disabled" id="ime_product" name="ime_product" size="50"></td>
                            </tr>
                            <tr>
                                <td><label for="name_product">Tên: </label></td>
                                <td><input type="text" id="name_product" name="name_product" maxlength="100"
                                           placeholder="Nhập tên sản phẩm" required="true" autofocus="true" size="50">
                                </td>
                            </tr>
                            <tr>
                                <td><label for="price_product">Đơn giá: </label></td>
                                <td><input type="text" required="true" id="price_product" name="price_product" size="50"
                                           maxlength="10" value="0"></td>
                            </tr>

                            <tr>
                                <td><label for="cat_product">Menu: </label></td>
                                <td><select id="cat_product" name="cat_product" required="required">
                                    </select></td>
                            </tr>
                            <tr>
                                <td><label for="cat_product">Nhà sản xuất: </label></td>
                                <td><input id="manufactory" name="manufactory" required="required"/>
                                </td>
                            </tr>

                            <tr>
                                <td><label for="brief_product">Cấu hình: </label></td>
                                <td><textarea id="brief_product" name="brief_product" cols="37"></textarea></td>
                            </tr>

                            <tr>
                                <td><label for="image_url">Ảnh đại diện: </label></td>
                                <td><input type="text" id="image_url" name="image_url" placeholder="Nhập ảnh đại diện"
                                           value="../images/default.jpg" size="50" disabled="disabled">
                                    <input type="button" value="Chọn file" onclick="browserImage();"/></td>
                            </tr>

                            <tr>
                                <td colspan="2"><label for="content_product">Nội dung: </label></td>
                            </tr>
                            <tr>
                                <td colspan="2"><textarea id="content_product" name="content_product" class="ckeditor">
                                    </textarea></td>
                            </tr>
                            <tr>
                                <td colspan="2"><input type="submit" value="Lưu lại" onclick="createProduct();return false;"
                                           style="width: 100px"></td>
                            </tr>
                        </table>
                </form>

                <div class="clear"/>
            </div>
        </section>

        <section class="list-content">
            <div id="product_list">
            </div>
            <div class="clear"/>
        </section>

        <div class="clear"/>
    </article>

<?php include 'footer.php' ?>